package org.ala.tiktools.sharddb.mybatis.router.shard_key_router;

/**
 * @author ala
 * @date 2025-03-19 09:27
 */
public interface IShardKeyConverter<E, SK extends IShardKey> {
    /**
     *  空值
     */
    public static IShardKeyConverter NULL = new IShardKeyConverter(){
        @Override
        public IShardKey convert(Object o) {
            return null;
        }
        @Override
        public Object deConvert(Object o, IShardKey iShardKey) {
            return null;
        }
    };
    /**
     *  转换
     */
    SK convert(E e);
    /**
     *  反向转换
     */
    E deConvert(E e, SK sk);
}
